package initialize

import (
	"log"
	"mxshop-api/minio-web/global"
	"mxshop-api/minio-web/service"
)

// InitializeFileService 初始化 MinioClient 和 FileService
func InitializeFileService() *service.MinioClient {
	srv := global.ServerConfig.MinioInfo
	// 创建 MinioClient 实例
	minioClient, err := service.NewMinioClient(srv.Host, srv.ApiKey, srv.ApiSecrect, srv.UseSSL)
	if err != nil {
		log.Fatalf("Failed to initialize Minio client: %v", err)
	}
	return minioClient
}
